
#!/bin/bash

SET=instructions.conf


file=${1}


getCPI(){
    case "$1" in
	"mem")
	    echo 10
	    ;;
        "mudi") 
	    echo 20
	    ;;
	"out") 
	    echo 1
	    ;;
    esac
}

mudi=0
mem=0
out=0
while read line
do
    cmd=$(echo ${line} | cut -d "|" -f 1)
    tipo=$(echo ${line} | cut -d "|" -f 2)
    case ${tipo} in
	"mem") 
	    mem=$(echo "${mem} + 1" | bc)
	    ;;
	"out")
	    out=$(echo "${out} + 1" | bc )
	    ;;
	"mudi")
	    mudi=$(echo "${mudi} + 1" | bc)
	    ;;
    esac



    
done < ${SET}

echo "mem:${mem}"
echo "mudi:${mudi}"
echo "out:${out}"